package com.biz.primus.ms.commodity.feign;

import com.biz.primus.model.vendor.vo.VendorStatisticVo;
import com.biz.primus.model.vendor.vo.VendorVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author defei
 * @date 2017/9/13
 */
@FeignClient(qualifier = "vendorFeignClient", name = "service-vendor")
public interface VendorFeignClient {

    @GetMapping("findAll")
    List<VendorVo> findAll();

    @GetMapping("findOne")
    VendorVo findOne(@RequestParam("vendorId") Long vendorId);

    @PostMapping("updateVendorScore")
    void updateVendorScore(@RequestBody VendorVo vendorVo);

    @GetMapping("findByVendorName")
    VendorVo findByVendorName(@RequestParam("defaultVendorName") String defaultVendorName);

    @GetMapping("getVendorStastic")
    VendorStatisticVo getVendorStastic(@RequestParam("vendorId") Long vendorId);

    @GetMapping("findById")
    VendorVo findById(@RequestParam("vendorId") Long vendorId);

    @PostMapping("findVendorByIdsWithNull")
    List<VendorVo> findVendorByIdsWithNull(@RequestBody List<Long> vendorId);
}
